import { getWorkPayRecord } from '../../../api/app.js'
Page({
    data: {
        workerId: '',
        projectId: '',
        todo: {},
        list: []
    },
    onLoad: function (options) {
        this.setData({
            workerId: options.userId,
            projectId: options.projectId
        })
    },
    getProject(event) {
        getWorkPayRecord({
            userId: this.data.workerId,
            projectId: this.data.projectId || '',
            nowDate: event.detail
        }).then(res=>{
            const data={}
            for(const i in res.date){
                data[res.date[i]] = res.date[i]
            }
            this.setData({
                todo: data,
                list: res.list
            })
        })
    }
})